<template>
  <div class="gs-header">
    <cube-toolbar :actions="actions" @click="handleHeader"></cube-toolbar>
  </div>
</template>

<script>
import { goBack } from 'example/utils/page'

export default {
  name: 'GsHeader',
  data () {
    return {
      actions: [
        {
          text: '<div class="cubeic-back"></div>',
          action: 'goBack'
        },
        {
          text: this.title
        },
        {
          text: ''
        }
      ]
    }
  },
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    handleHeader (item) {
      if (item.action === 'goBack') {
        goBack(this)
      }
    }
  }
}
</script>
